import time
def bubble(massiv, N):
    for i in range(N-1):
        for j in range (N-i-1):
            if massiv[j]>massiv[j+1]:
                 massiv[j], massiv[j+1]=massiv[j+1], massiv[j]

def readl(filename):
    file=open(filename, "r")
    data=file.readlines()
    return data
m1=readl("massiv.txt")
razmer=len(m1)
t_start=time.time()
bubble(m1,razmer)
t_finish=time.time()
print("m1_sortirated", round((t_finish-t_start)*1000),"milliseconds")
m2=readl("massiv.txt")
razmer=len(m2)
t_start=time.time()
bubble(m2,razmer)
t_finish=time.time()
print("m2_reversed", round((t_finish-t_start)*1000),"milliseconds")
m3=readl("massiv.txt")
razmer=len(m3)
t_start=time.time()
bubble(m3,razmer)
t_finish=time.time()
print("m3_shuffled", round((t_finish-t_start)*1000),"milliseconds")
